home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / MVCUR.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  55 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef mvcur
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_mvcur = "$Header: c:/curses/portable/RCS/mvcur.c%v 2.0 1992/11/15 03:29:00 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   mvcur()      - low-level cursor movement
  15.  
  16.   Ultrix 4.1 Description:
  17.        This function controls low-level cursor motion with optimization.
  18.  
  19.   PDCurses Description:
  20.        There is no optimization here since the PC has memory mapped
  21.        video and we support, under certain compilation options, direct
  22.        video writes.
  23.  
  24.   PDCurses Return Value:
  25.        The mvcur() function returns OK on success and ERR on error.
  26.  
  27.   PDCurses Errors:
  28.        If the new cursor position is outside the physical screen size,
  29.        an error occurs.
  30.  
  31.   Portability:
  32.        PDCurses        int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  33.        BSD Curses      int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  34.        SYS V Curses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  35.  
  36. **man-end**********************************************************************/
  37.  
  38. int    mvcur(int oldrow, int oldcol, int newrow, int newcol)
  39. {
  40. #ifdef TC
  41. #  pragma argsused
  42. #endif
  43.        if ((newrow >= LINES)   ||
  44.            (newcol >= COLS)    ||
  45.            (newrow < 0)        ||
  46.            (newcol < 0))
  47.        {
  48.                return( ERR );
  49.        }
  50.        PDC_gotoxy( newrow, newcol );
  51.        _cursvar.cursrow = newrow;
  52.        _cursvar.curscol = newcol;
  53.        return( OK );
  54. }
  55.